import { createI18n } from 'vue-i18n'
import en from './locales/en.json'
import zh from './locales/zh.json'
import ElementPlusEN from 'element-plus/dist/locale/en.mjs'
import ElementPlusZH from 'element-plus/dist/locale/zh-cn.mjs'

const messages = {
    en: { ...en, ...ElementPlusEN }, // 合并项目语言与Element语言
    zh: { ...zh, ...ElementPlusZH }
}

export default createI18n({
    legacy: false,
    locale: localStorage.getItem('lang') || 'zh',
    messages
})